package com.feihao.zhou.mapper;

import com.feihao.zhou.bean.Course;
import com.feihao.zhou.bean.Student;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CourseMapper {

    //根据查询到id  来查询班课程对应的学生集合：

    @Select("select course.name,course.id from course,stu_cr where course.id=stu_cr.cid and stu_cr.sid=#{id}")
        // 只有一个参数时，可随意命名
    /*@Results({
            @Result(column = "id" , property = "id"),
            @Result(column = "name" , property = "name")
    })*/

    List<Course> selectAllCourseByStudentId();


}
